package com.tengju.data.domain.model.clickhouse.star;

import lombok.Getter;

import java.util.Arrays;

@Getter
public enum StarChangeNoticeType {

    UPGRADE(1, "升星"),
    DOWNGRADE(2, "降星"),
    UP_SOON(3, "即将晋升");

    private int type;
    private String desc;

    private StarChangeNoticeType(int type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public int getType() {
        return type;
    }

    public static StarChangeNoticeType getByType(int type) {
        return Arrays.stream(StarChangeNoticeType.values()).filter(k->k.getType() == type)
                .findFirst().orElse(null);
    }
}
